The Usage

From Documentation


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


The zk_page and zk_richlet Parameter and Attribute

ZK portlet loader is a generic loader. To load a particular ZUML page, you have to specify either a request parameter, a portlet attribute or a portlet preference called zk_page, if you want to load a ZUML page, or zk_richlet, if you want to load a richlet.

More precisely, ZK portlet loader first checks the following locations for the path of the ZUML page or the richlet. The lower the number, the higher the priority.

  1. The request parameter (RenderRequest's getParameter) called zk_page. If found, it is the path of the ZUML page.
  2. The request attribute (RenderRequest's getAttribute) called zk_page. If found, it is the path of the ZUML page.
  3. The request preference (RenderRequest's getPortletPreferences's getValue) called zk_page. If found, it is the path of the ZUML page.
  4. The request parameter (RenderRequest's getParameter) called zk_richlet. If found, it is the path of the richlet.
  5. The request attribute (RenderRequest's getAttribute) called zk_richlet. If found, it is the path of the richlet.
  6. The request preference (RenderRequest's getPortletPreferences's getValue) called zk_richlet. If found, it is the path of the richlet.
  7. The initial parameter (PortletConfig's getInitParameter) called zk_page. If found, it is the path of the ZUML page.

Examples

How to pass a request parameter or attribute to a portlet depends on the portal. You have to consult the user's guide of your favorite portal for details. The following is an example that uses Potix Portal.

 <layout contentType="text/html">
     <title>ZK Portlet Demo</title>
     <header name="Cache-Control" value="no-cache"/>
     <header name="Pragma" value="no-cache"/>

     <vbox>
         <hbox>
             <servlet page="sample1.zul"/>
             <portlet name="zkdemo.zkLoader">
                 <attribute name="zk_page" value="/test/sample2.zul"/>
             </portlet>
         </hbox>
     </vbox>

     <molds uri="~./pxp/html/molds.xml"/>
 </layout>



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.